<template>
	<view class="app_Cont">
		<view class="showCont">
			<view class="bannerCont" v-if="false">
				<image src="/static/img/idea_banner.png"></image>
			</view>
			<view class="formCont">
				<view class="formTitle">意见箱</view>
				<view class="formItem">
					<textarea v-model="feedback_content" placeholder="请输入意见内容" ></textarea>
				</view>
			</view>
			<view :class="feedback_content.length>10?'saveBtn':'saveBtn disBtn'" @click="saveFn">投递意见</view>
		</view>
		<u-toast ref="uToast"></u-toast>
		
		<subLoad v-if="showSub"></subLoad>
	</view>
</template>

<script>
	import api from '@/http/api.js'
	
	import subLoad from '@/components/sub.vue'
	export default {
		components:{subLoad,},
		data() {
			return {
				
				showSub:false,
				feedback_content:'',
			};
		},
		methods:{
			saveFn(){
				if(this.feedback_content.length<10){
					return false
				}
				this.showSub = true
				api.getRequst({feedback_content:this.feedback_content},'/api/My/feedbackSave').then((res)=>{
					if(res.code==1){
						this.showStatus = false
						this.$refs.uToast.show({
							message:'意见反馈成功',
						})
						this.feedback_content = ''
					}
					this.showSub = false
				})
			}
		},
	}
</script>

<style lang="scss">
.showCont{
	min-height: 100vh;
	background-color: #f8f8f8;
	box-sizing: border-box;
	padding-bottom: 30rpx;
	.bannerCont{
		padding-top: 120rpx;
		background-image: linear-gradient(to bottom,#3f55cc,#f8f8f8);
		image{
			width: 100%;
		}
	}
	.formCont{
		background-color: #fff;
		border-radius: 30rpx;
		padding: 40rpx 30rpx 60rpx;
		width: 92%;
		margin: 30rpx auto 30rpx;
		box-sizing: border-box;
		.formTitle{
			font-size: 32rpx;
			margin-bottom: 30rpx;
			font-weight: bold;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.addBtn{
				font-size: 24rpx;
				font-weight: normal;
				color: #3f55cc;
			}
		}
	}
	.hasTop{
		margin-top: -130rpx;
	}
	.saveBtn{
		width: 92%;
		margin: 30rpx auto 0;
		border-radius: 50rpx;
		background-image: linear-gradient(to right bottom,#a3bffe,#3f55cc);
		color: #fff;
		font-size: 24rpx;
		padding: 30rpx 0;
		text-align: center;
		z-index: 2;
	}
	.disBtn{
		opacity: 0.5;
	}
}
</style>
